package com.link4a.doms.web;

/**
 * @author brown
 */
public final class JsonResult {
	
	public static final int SUCCESS = 0;
	public static final int FAIL = 1;
	public static final int ERROR = 2;
	public static final int TIMEOUT = 3;
	public static final int PERMISSION_DENIED = 4;

	private int result;

	private String message;

	private Object data;

	public JsonResult() {
	}

	public JsonResult(int result) {
		this.result = result;
	}

	public JsonResult(int result, String message) {
		this.result = result;
		this.message = message;
	}

	public JsonResult(int result, String message, Object data) {
		this.result = result;
		this.message = message;
		this.data = data;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public int getResult() {
		return result;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getMessage() {
		return message;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Object getData() {
		return data;
	}

	public boolean isSuccess() {
		return result == 0;
	}

}
